;; set as setq-default to avoid changing by cursor-chg
(setq-default cursor-type 'box)

;; -------- multiple-cursors & expand-region --------
(use-package multiple-cursors
  :config
  (custom-set-variables
   '(mc/insert-numbers-default 1))
  ;; -------- hydra --------
  (defhydra hydra-multiple-cursors (global-map "C->" :hint nil)
    "
 Up^^             Down^^           Miscellaneous           % 2(mc/num-cursors) cursor%s(if (> (mc/num-cursors) 1) \"s\" \"\")
------------------------------------------------------------------
 [_p_]   Next     [_n_]   Next     [_l_] Edit lines  [_0_] Insert numbers
 [_P_]   Skip     [_N_]   Skip     [_a_] Mark all    [_A_] Insert letters
 [_U_]   Unmark   [_u_]   Unmark   [_r_] Search
                [_w_]   word     [_W_] All-Words
                [_s_]   symbol   [_S_] All-Symbols
 [Click] Cursor at point       [_q_] Quit        [_C-g_] Quit"
    ("l" mc/edit-lines :exit t)
    ("a" mc/mark-all-like-this :exit t)
    ("n" mc/mark-next-like-this)
    ("N" mc/skip-to-next-like-this)
    ("u" mc/unmark-next-like-this)
    ("w" mc/mark-next-like-this-word)
    ("s" mc/mark-next-like-this-symbol)
    ("p" mc/mark-previous-like-this)
    ("P" mc/skip-to-previous-like-this)
    ("U" mc/unmark-previous-like-this)
    ;; ("M-w" mc/mark-previous-like-this-word)
    ;; ("M-s" mc/mark-previous-like-this-symbol)
    ("r" mc/mark-all-in-region-regexp :exit t)
    ("W" mc/mark-all-words-like-this-in-defun)
    ("S" mc/mark-all-symbols-like-this-in-defun)
    ("0" mc/insert-numbers :exit t)
    ("A" mc/insert-letters :exit t)
    ("<mouse-1>" mc/add-cursor-on-click)
    ;; Help with click recognition in this hydra
    ("<down-mouse-1>" ignore)
    ("<drag-mouse-1>" ignore)
    ("q" nil)
    ("C-g" nil)))
;; :bind
;; (further more keybindings using hydra
;;          ("C-S-c" . 'mc/edit-lines)
;;          ("C->" . 'mc/mark-next-like-this)
;;          ("C-<" . 'mc/mark-all-words-like-this-in-defun)
;;          ("C-=" . 'er/expand-region))

;; -------- move where I mean --------
(use-package mwim
  :bind
  (:map prog-mode-map
	    ("C-a" . 'mwim-beginning-of-code-or-line)
	    ("C-e" . 'mwim-end-of-line-or-code)))

;; ;; -------- move cursor window2window --------
;; ;; www.emacswiki.org/emacs/WindMove
;; ;; github.com/emacs-mirror/emacs/blob/master/lisp/windmove.el
;; (use-package windmove
;;   :load-path "site-lisp"
;;   :ensure t
;;   :config
;;   (windmove-default-keybindings 'super)
;;   ;; (setq windmove-wrap-around t) ;; circling move
;;   :bind
;;   (("C-c h" . 'windmove-left)
;;    ("C-c l" . 'windmove-right)))

(provide '+cursor)
